package com.zx.mes.hyl.security.core.validate.code.image;

import com.zx.mes.hyl.security.core.validate.code.ValidateCode;

import java.awt.image.BufferedImage;
import java.time.LocalDateTime;

/**
 * 图片验证码
 * @author hyl
 * @date 2018-5-31
 */
public class ImageCode extends ValidateCode{

    private BufferedImage image;

    /**
     * 携带超时秒数
     * @param code code
     * @param expireIn 超时 seconds
     * @param image BufferedImage
     */
    public ImageCode(String code, int expireIn, BufferedImage image) {
        super(code, expireIn);
        this.image = image;
    }

    /**
     * 携带本地当前时间
     * @param code code
     * @param expireTime 本地当前时间
     * @param image BufferedImage
     */
    public ImageCode(String code, LocalDateTime expireTime, BufferedImage image) {
        super(code, expireTime);
        this.image = image;
    }

    public BufferedImage getImage() {
        return image;
    }

    public void setImage(BufferedImage image) {
        this.image = image;
    }
}
